<?php


class UserController extends CI_Controller{
	
	function login($error = null){
		
		if ( get_instance()->session->userdata('current_user')) header('Location:' .
			get_instance()->config->item('base_url') . '/index' );

		if ($error == 'fail') $data['error'] = 'Wrong username and password!'; 
		$data['no_menu'] = true;
		$data['content'] = get_instance()->load->view('content/login-content',$data,TRUE);
		get_instance()->load->view('templates/layout', $data);
	}
	
	function logout(){

		get_instance()->load->model('users/User');
		get_instance()->User->logSelfOut();
		get_instance()->load->view('partial/logout');

	}

}